package com.ctshk.rpc.payment.dto;

import com.ctshk.rpc.payment.enums.PayOrderStatus;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * @BelongsProject: ctshk-cloud
 * @BelongsPackage: com.ctshk.rpc.payment.dto
 * @Author: hef
 * @CreateTime: 2021-05-06 11:33
 * @Description: 付款明细
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Accessors(chain = true)
public class PayDetailsDTO implements Serializable {
    /**
     * 订单号
     */
    private String orderNumber;
    /**
     * 订单时间
     */
    private LocalDateTime orderTime;
    /**
     * 支付时间
     */
    private LocalDateTime paymentTime;
    /**
     * 支付状态
     */
    private PayOrderStatus paymentStatus;
    /**
     * 订单金额
     */
    private BigDecimal orderAmount;
    /**
     * 用户账号
     */
    private String userAccount;
    /**
     * 是否已支付
     * @return
     */
    public boolean isPaid() {
        return PayOrderStatus.FULFIL.equals(paymentStatus);
    }

    @JsonIgnore
    public String primaryStatus;
}
